package com.ujiuye.controller;

import com.ujiuye.service.IInfoService;
import com.ujiuye.utils.MessageConstant;
import com.ujiuye.utils.Result;
import com.ujiuye.vo.InfoVo;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/info")
public class InfoController {

    @Reference
    private IInfoService infoService;

    @GetMapping("/list/{id}")
    public Result list(@PathVariable("id") int memberId){
        try {
            InfoVo infoVo = infoService.listInfoVo(memberId);
            return new Result(true,MessageConstant.GET_ORDERINFOLIST_SUCCESS,infoVo);
        } catch (Exception e) {
            e.printStackTrace();
            return new Result(false,MessageConstant.GET_ORDERINFOLIST_FAIL);
        }
    }

}
